package com.yihusitian.zsxq.pojo.data;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

import java.util.Date;

/**
 * @Description TODO
 * @Author LeeHo
 * @Date 2021-03-25 16:32:37
 */
@Data
@Builder
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_like")
public class LikeDO extends Model<LikeDO> implements Serializable {

	private static final long serialVersionUID = -8640016520622273167L;

	//主键id
	@TableId(value = LikeColumn.ID)
	private Long id;
	
	//点赞者ID
	@TableField(value = LikeColumn.OWNER_ID, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Long ownerId;
	
	//主题ID
	@TableField(value = LikeColumn.TOPIC_ID, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Long topicId;
	
	//创建时间
	@TableField(value = LikeColumn.CREATE_TIME, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Date createTime;
	
	//更新时间
	@TableField(value = LikeColumn.UPDATE_TIME, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Date updateTime;
	
	@Override
    protected Serializable pkVal() {
        return id;
    }
	
	public class LikeColumn{
		public static final String ID = "id";
		public static final String OWNER_ID = "owner_id";
		public static final String TOPIC_ID = "topic_id";
		public static final String CREATE_TIME = "create_time";
		public static final String UPDATE_TIME = "update_time";
	}
}